<?php
    // +----------------------------------------------------------------------
    // | 关注
    // +----------------------------------------------------------------------
    // | Copyright (c) 2015-2024 http://www.yicmf.com, All rights reserved.
    // +----------------------------------------------------------------------
    // | Author: 微尘 <yicmf@qq.com>
    // +----------------------------------------------------------------------
    namespace app\model\ucenter;

    use think\db\Where;
    use think\facade\Config;
    use think\facade\Log;
    use think\model\Pivot;

    class UserFollow extends Pivot
    {
        protected $autoWriteTimestamp = true;

		protected $type = [
			'info' => 'array',
		];

		public function user()
		{
			return $this->belongsTo(User::class);
		}

		/**
		 * 写入修改
		 * @param $data
		 */
		public static function onBeforeInsert($data)
		{
			$data['status'] = 1;
			$data['ip'] = request()->ip();
		}

    }
